package com.yiduo.outpost.core.feign.config;

import com.yiduo.outpost.core.feign.insterceptor.OpenFeignUserTokenInterceptor;
import feign.Logger;
import feign.RequestInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(RequestInterceptor.class)
public class OpenFeignAutoConfiguration {

    @Bean
    public OpenFeignUserTokenInterceptor userTokenInterceptor() {
        return new OpenFeignUserTokenInterceptor();
    }

    @Bean
    Logger.Level feignLevel() {
        return Logger.Level.FULL;
    }
}
